<template>
	<div>
		<top-nav bgColor="white" title="线上订单"  btnName="新增"  :rightShow="true" returnPath="factoryList"  @fatherDo="goAddBills"></top-nav>
		
		<div style="width: 100%;height: 3rem;"></div>
		<mu-checkbox label="所有订单" class="demo-checkbox"  v-model='checkdshowclose' @change="checkbox" />
		
		
		<div v-show="showList">
		<order-card-item v-for="item in list"
			:key = "item.ID"
			:ID="item.ID"
			:BillNo="item.BillNo"
			:CustomName="item.CustomName"
			:ItemName="item.ItemName"
			:Qty="item.Qty"
			:Item="item"
          />
          </div>
     	<div v-show="!showList">
		<mu-circular-progress :size="24" color="blue500"/>
		</div>	
          
          <div style="width: 100%;height: 8rem;"></div>
	</div>
</template>

<script>
	
	import OrderCardItem from '@/pages/project/demo2/grantBills/orderCardItem.vue'
    
    
    
	export default{
		components:{
			OrderCardItem

		},
		data(){
			return{

				list:[],
				checkshowclose: false,
				showList:false,
			}
		},
		mounted(){
			
			console.info(this.list)		

			
			this.getAppOrderList()
			
			
		},
		methods:{
			
		    goAddBills(){
				let that=this
				that.$router.push({
					path:'/demo2AddGrantBills'
				})
			},
			getAppOrderList(){

				
				let that=this
				let showclose
				if(that.checkdshowclose){
				showclose=0
				}else
				{
				showclose=1
				}
				that.axios.post('/demo2/getAppOrderList',{
					'factoryId':localStorage.factoryId,
					'uid':localStorage.uid,
					'showclose':showclose
				}).then(function(response){
					console.info(response.data.data)
					that.showList=true
					that.list=response.data.data.list
				}).catch(function(error){
					
				})
				

			},
			checkbox()
			{
				this.getAppOrderList()
			}
		}
	}
</script>

<style>
</style>
